package com.lanchetech.dao;
import java.util.List;

import com.lanchetech.bean.request.PageReq;
import com.lanchetech.bean.response.TracksResp;
import org.apache.ibatis.annotations.Param;

import com.lanchetech.entity.Tracks;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface TracksMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Tracks record);

    int insertSelective(Tracks record);

    Tracks selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Tracks record);

    int updateByPrimaryKey(Tracks record);

    int deleteByIdAndUserId(@Param("id")Long id,@Param("userId")Long userId);

    Long countByUserId(@Param("userId")Long userId);

    int deleteByUserIdAndSpuIdToday(@Param("userId")Long userId,@Param("spuId")Long spuId);

    List<TracksResp> findAllPage(PageReq req);

    int deleteFirstByUserId(@Param("userId")Long userId, @Param("limit")Long limit);

    Tracks findLatestOneByUserId(@Param("userId")Long userId);


}